const router = require("express").Router();

const db = require("../config/db");

router.post("/register", (req, res) => {
  let { username, password } = req.body;

  let sql = "insert into  register(username,password)  values ( ?, ? )";

  let data = [username, password];
  console.log(username, password);
  db.query(sql, data, (err) => {
    if (err) {
      console.log(err);
    }
    res.send({
      code: 200,
      msg: "注册成功",
    });
  });
});

module.exports = router;
